dnd: Drop suggested_action
authorMatthias Clasen <mclasen@redhat.com>
Wed, 4 Jul 2018 06:40:49 +0000 (08:40 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 12 Jul 2018 11:02:42 +0000 (13:02 +0200)
The only user of this field was the x11 backend, and it
turns out that it does not need to store the value at all.

gdk/gdkdrag.c
gdk/gdkdrag.h
gdk/gdkdragprivate.h
gdk/x11/gdkdnd-x11.c

index ff8472d259cca8509052449002d6496eef3b4e02..58878c9076b4d3435b9e6bf3a02e9fb03bf829fe 100644 (file)
@@ -130,8 +130,7 @@ gdk_drag_get_formats (GdkDrag *drag)
  * gdk_drag_get_actions:
  * @drag: a #GdkDrag
  *
- * Determines the bitmask of actions proposed by the source if
- * gdk_drag_get_suggested_action() returns %GDK_ACTION_ASK.
+ * Determines the bitmask of possible actions proposed by the source.
  *
  * Returns: the #GdkDragAction flags
  **/
@@ -143,22 +142,6 @@ gdk_drag_get_actions (GdkDrag *drag)
   return drag->actions;
 }
 
-/**
- * gdk_drag_get_suggested_action:
- * @drag: a #GdkDrag
- *
- * Determines the suggested drag action of the GdkDrag object.
- *
- * Returns: a #GdkDragAction value
- **/
-GdkDragAction
-gdk_drag_get_suggested_action (GdkDrag *drag)
-{
-  g_return_val_if_fail (GDK_IS_DRAG (drag), 0);
-
-  return drag->suggested_action;
-}
-
 /**
  * gdk_drag_get_selected_action:
  * @drag: a #GdkDrag
@@ -620,13 +603,6 @@ gdk_drag_set_actions (GdkDrag       *drag,
   g_object_notify_by_pspec (G_OBJECT (drag), properties[PROP_ACTIONS]);
 }
 
-void
-gdk_drag_set_suggested_action (GdkDrag       *drag,
-                               GdkDragAction  suggested_action)
-{
-  drag->suggested_action = suggested_action;
-}
-
 void
 gdk_drag_set_selected_action (GdkDrag       *drag,
                               GdkDragAction  action)
index dd24c72fb137af35b2051616ca3449de0dbc3e64..984fc8099571c8038be5917e948bf56ff82fa819 100644 (file)
@@ -66,8 +66,6 @@ GdkContentFormats *gdk_drag_get_formats        (GdkDrag *drag);
 GDK_AVAILABLE_IN_ALL
 GdkDragAction    gdk_drag_get_actions          (GdkDrag *drag);
 GDK_AVAILABLE_IN_ALL
-GdkDragAction    gdk_drag_get_suggested_action (GdkDrag *drag);
-GDK_AVAILABLE_IN_ALL
 GdkDragAction    gdk_drag_get_selected_action  (GdkDrag *drag);
 
 GDK_AVAILABLE_IN_ALL
index 71dca2a8888285bdc46d238e3e950ea7b5732647..8aa3f9bf705e4ae4c80a90c90462376e6e9c21c3 100644 (file)
@@ -70,7 +70,6 @@ struct _GdkDrag {
 
   GdkDragAction actions;
   GdkDragAction selected_action;
-  GdkDragAction suggested_action;
 
   guint drop_done : 1; /* Whether gdk_drag_drop_done() was performed */
 };
@@ -79,8 +78,6 @@ void     gdk_drag_set_cursor          (GdkDrag        *drag,
                                        GdkCursor      *cursor);
 void     gdk_drag_set_actions         (GdkDrag        *drag,
                                        GdkDragAction   actions);
-void     gdk_drag_set_suggested_action (GdkDrag       *drag,
-                                       GdkDragAction   suggested_action);
 void     gdk_drag_set_selected_action (GdkDrag        *drag,
                                        GdkDragAction   action);
 
index e6b410efa0928033c63565bbeb20187203b2fd7d..f42b133fa0f4df39492c6d077835b211677fed69 100644 (file)
@@ -1478,7 +1478,6 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
     move_drag_surface (drag, x_root, y_root);
 
   gdk_drag_set_actions (drag, possible_actions);
-  gdk_drag_set_suggested_action (drag, suggested_action);
 
   if (protocol == GDK_DRAG_PROTO_XDND && drag_x11->version == 0)
     {
@@ -1582,7 +1581,7 @@ gdk_x11_drag_drag_motion (GdkDrag *drag,
                  */
                 if (gdk_content_formats_contain_mime_type (formats, "application/x-rootwindow-drop") ||
                     gdk_content_formats_contain_mime_type (formats, "application/x-rootwin-drop"))
-                  gdk_drag_set_selected_action (drag, gdk_drag_get_suggested_action (drag));
+                  gdk_drag_set_selected_action (drag, suggested_action);
                 else
                   gdk_drag_set_selected_action (drag, 0);
 
@@ -2248,19 +2247,20 @@ gdk_drag_update (GdkDrag         *drag,
                  guint32          evtime)
 {
   GdkX11Drag *x11_drag = GDK_X11_DRAG (drag);
-  GdkDragAction action, possible_actions;
+  GdkDragAction suggested_action;
+  GdkDragAction possible_actions;
   GdkDragProtocol protocol;
   Window proxy;
 
   gdk_drag_get_current_actions (mods, GDK_BUTTON_PRIMARY, x11_drag->actions,
-                                &action, &possible_actions);
+                                &suggested_action, &possible_actions);
 
   proxy = gdk_x11_drag_find_surface (drag,
-                                             x11_drag->drag_surface,
-                                             x_root, y_root, &protocol);
+                                     x11_drag->drag_surface,
+                                     x_root, y_root, &protocol);
 
   gdk_x11_drag_drag_motion (drag, proxy, protocol, x_root, y_root,
-                                    action, possible_actions, evtime);
+                            suggested_action, possible_actions, evtime);
 }
 
 static gboolean